const app = getApp()
Component({
  properties: {
    backColor: {
      type: String,
      value: ''
    },
    hideHomeBtn: {
      type: Boolean,
      value: !1
    },
    hideBackBtn: {
      type: Boolean,
      value: !1
    },
    titleColor: {
      type: String,
      value: ''
    },
    title: {
      type: String,
      value: ''
    },
    backType: {
      type: String,
      value: ''
    }
  },
  data: {
    showBackBtn: !0,
    isX: app.globalData.isIphoneX,
    iPad: app.globalData.iPad
  },
  ready () {
    let t = getCurrentPages()
    this.setData({
      showBackBtn: t.length > 1,
      navHeight: app.globalData.navHeight
    })
  },
  methods: {
    navigationBack () {
      switch (parseInt(this.properties.backType)) {
        case 1:
          wx.switchTab({
            url: '/pages/shopping/shopping'
          })
          break
        default:
          wx.navigateBack({
            delta: 1
          })
          break
      }
    },
    navigationToHome () {
      wx.switchTab({
        url: '/pages/shopping/shopping'
      })
    }
  }
})
